package com.softgroup.breath.easyecgproject.entry;

import android.util.Log;

import com.google.gson.Gson;

import java.io.InputStream;

import static com.softgroup.breath.easyecgproject.utils.IOStreamUtil.readTextFromSDcard;

public class UserSendInfo {

    /**
     * op : post
     * resource : user
     * username : 张三
     * userage : 30
     * usersex : 男
     * sessionid : 26866ddea7984d4387c769b66aae8a41
     */

    private String op;
    private String resource;
    private String username;
    private String userage;
    private String usersex;
    private String sessionid;
    private static UserSendInfo userSendInfo;
    private static String text=" {\"op\": \"post\",\"resource\": \"user\",\"username\": \"张三\",\"userage\": \"30\",\"usersex\": \"男\",\"sessionid\":\"26866ddea7984d4387c769b66aae8a41\"}";
    private UserSendInfo() {
    }

    public static UserSendInfo getInstance() {
        if (userSendInfo == null) {
            synchronized (UserSendInfo.class) {
                    try {
                        if (userSendInfo == null) {
                            Gson gson = new Gson();
                            userSendInfo = gson.fromJson(text, UserSendInfo.class);
                        }
                    } catch (Exception e) {
                        // TODO Auto-generated catch block
                        Log.d("readFromAssets", e.toString());
                    }
            }
        }
        return userSendInfo;
    }

    public String getOp() {
        return op;
    }

    public void setOp(String op) {
        this.op = op;
    }

    public String getResource() {
        return resource;
    }

    public void setResource(String resource) {
        this.resource = resource;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getUserage() {
        return userage;
    }

    public void setUserage(String userage) {
        this.userage = userage;
    }

    public String getUsersex() {
        return usersex;
    }

    public void setUsersex(String usersex) {
        this.usersex = usersex;
    }

    public String getSessionid() {
        return sessionid;
    }

    public void setSessionid(String sessionid) {
        this.sessionid = sessionid;
    }
}
